package com.playball.lottery.util;

import com.playball.lottery.ApplicationData;
import com.playball.lottery.frm.buyhall.BDActivity;
import com.playball.lottery.frm.buyhall.CQSSCActivity;
import com.playball.lottery.frm.buyhall.CtzqRx9Activity;
import com.playball.lottery.frm.buyhall.CtzqSfcActivity;
import com.playball.lottery.frm.buyhall.DltxhActivity;
import com.playball.lottery.frm.buyhall.DltxhlbActivity;
import com.playball.lottery.frm.buyhall.ElvSelFiveActivity;
import com.playball.lottery.frm.buyhall.ElvYunDJActivity;
import com.playball.lottery.frm.buyhall.Fc3dListActivity;
import com.playball.lottery.frm.buyhall.Fc3dxhActivity;
import com.playball.lottery.frm.buyhall.JcBasketballActivity;
import com.playball.lottery.frm.buyhall.JcfootballActivity;
import com.playball.lottery.frm.buyhall.Kuai3Activity;
import com.playball.lottery.frm.buyhall.N7lxhActivity;
import com.playball.lottery.frm.buyhall.N7lxhlbActivity;
import com.playball.lottery.frm.buyhall.N7xxhActivity;
import com.playball.lottery.frm.buyhall.N7xxhlbActivity;
import com.playball.lottery.frm.buyhall.Pailie3ListActivity;
import com.playball.lottery.frm.buyhall.Pailie3xhActivity;
import com.playball.lottery.frm.buyhall.Pailie5ListActivity;
import com.playball.lottery.frm.buyhall.Pailie5xhActivity;
import com.playball.lottery.frm.buyhall.SsqxhActivity;
import com.playball.lottery.frm.buyhall.SsqxhlbActivity;

/**
 * 开奖相关工具类,及竞彩篮球胜分差转换格式
 * 
 * @author Administrator
 * 
 */
public class KaiJiangUtil {

	/**
	 * 转化服务器竞彩篮球胜分差赛果信息，用于开奖赛果显示。见网站格式排列顺序.篮球胜分差：11：客胜1-5；12：客胜6-10；13：客胜11-15；14：客胜16-20
	 * ；15：客胜21-25；16：客胜26+
	 * 01：主胜1-5；02：主胜6-10；03：主胜11-15；04：主胜16-20；05：主胜21-25；06：主胜26+
	 * 
	 * @param sfc
	 *            01
	 * @return 主胜 1-5
	 */
	public static String dealJCLQSFC(String sfc) {
		String strSfc = "";
		if ("01".equals(sfc)) {
			strSfc="主胜1-5";
		} else if ("02".equals(sfc)) {
			strSfc="主胜6-10";
		} else if ("03".equals(sfc)) {
			strSfc="主胜11-15";
		} else if ("04".equals(sfc)) {
			strSfc="主胜16-20";
		} else if ("05".equals(sfc)) {
			strSfc="主胜21-25";
		} else if ("06".equals(sfc)) {
			strSfc="主胜26+";
		} else if ("11".equals(sfc)) {
			strSfc="客胜1-5";
		} else if ("12".equals(sfc)) {
			strSfc="客胜6-10";
		} else if ("13".equals(sfc)) {
			strSfc="客胜11-15";
		} else if ("14".equals(sfc)) {
			strSfc="客胜16-20";
		} else if ("15".equals(sfc)) {
			strSfc="客胜21-25";
		} else if ("16".equals(sfc)) {
			strSfc="客胜26+";
		}
		return strSfc;
	}
	
	/**
	 * 转化服务器竞彩篮球胜分差赛果信息，用于投注。见网站格式排列顺序.篮球胜分差：11：客胜1-5；12：客胜6-10；13：客胜11-15；14：客胜16-20
	 * ；15：客胜21-25；16：客胜26+
	 * 01：主胜1-5；02：主胜6-10；03：主胜11-15；04：主胜16-20；05：主胜21-25；06：主胜26+
	 * 
	 * @param sfc 客胜11-15
	 * @return 13
	 */
	public static String deal2JCLQSFC(String sfc) {
		String strSfc = "";
		if ("主胜1-5".equals(sfc)) {
			strSfc="01";//01
		} else if ("主胜6-10".equals(sfc)) {
			strSfc="02";
		} else if ("主胜11-15".equals(sfc)) {
			strSfc="03";
		} else if ("主胜16-20".equals(sfc)) {
			strSfc="04";
		} else if ("主胜21-25".equals(sfc)) {
			strSfc="05";
		} else if ("主胜26+".equals(sfc)) {
			strSfc="06";
		} else if ("客胜1-5".equals(sfc)) {
			strSfc="11";
		} else if ("客胜6-10".equals(sfc)) {
			strSfc="12";
		} else if ("客胜11-15".equals(sfc)) {
			strSfc="13";
		} else if ("客胜16-20".equals(sfc)) {
			strSfc="14";
		} else if ("客胜21-25".equals(sfc)) {
			strSfc="13";
		} else if ("客胜26+".equals(sfc)) {
			strSfc="16";
		}
		return strSfc;
	}
	
	/**
	 * 根据LOTID获取自选彩种对应Activity
	 * 
	 * @param lotid
	 *            彩种ID
	 * @return 彩种Activity
	 */
	public static Class getZiXuanActivity(int lotid) {
		Class act = null;
		if (lotid == LotConstants.LOT_ID_SSQ) {
			act = SsqxhActivity.class;
		} else if (lotid == LotConstants.LOT_ID_DLT) {
			act = DltxhActivity.class;
		} else if (lotid == LotConstants.LOT_ID_FC3D) {
			act = Fc3dxhActivity.class;
		} else if (lotid == LotConstants.LOT_ID_QLC) {
			act = N7lxhActivity.class;
					//"七乐彩";
		} else if (lotid == LotConstants.LOT_ID_PL3) {
			act = Pailie3xhActivity.class;
					//"排列3";
		} else if (lotid == LotConstants.LOT_ID_PL5) {
			act = Pailie5xhActivity.class;
					//"排列5";
		} else if (lotid == LotConstants.LOT_ID_QXC) {
			act = N7xxhActivity.class;
					//"七星彩";
		}//胜负彩 任选九
//		else if (lotid == LotConstants.LOT_ID_ZQ_SFC) {
//			act = Pailie5xhActivity.class;
//		} else if (lotid == LotConstants.LOT_ID_ZQ_RX9) {
//			act = N7xxhActivity.class;
//		}
		return act;
	}
	
	/**
	 * 根据LOTID获取机选彩种对应Activity
	 * 
	 * @param lotId
	 *            彩种ID
	 * @return 彩种Activity
	 */
	public static Class getJiXuanActivity(int lotId) {
		Class act = null;
		if (lotId == LotConstants.LOT_ID_SSQ) {
			act = SsqxhlbActivity.class;
		} else if (lotId == LotConstants.LOT_ID_DLT) {
			act = DltxhlbActivity.class;
			ApplicationData.getInstance().setIsDLTZhuiJiaClick(false);
		} else if (lotId == LotConstants.LOT_ID_FC3D) {
			act = Fc3dListActivity.class;
		} else if (lotId == LotConstants.LOT_ID_QLC) {
			act = N7lxhlbActivity.class;
					//"七乐彩";
		} else if (lotId == LotConstants.LOT_ID_PL3) {
			act = Pailie3ListActivity.class;
					//"排列3";
		} else if (lotId == LotConstants.LOT_ID_PL5) {
			act = Pailie5ListActivity.class;
					//"排列5";
		} else if (lotId == LotConstants.LOT_ID_QXC) {
			act = N7xxhlbActivity.class;
					//"七星彩";
		}
		return act;
	}
	
	/**
	 * 根据lotname获取彩种对应Activity
	 * 
	 * @param lotname
	 *            彩种ID
	 * @return 彩种Activity
	 */
	public static Class getLotActivity(String lotname) {
		Class act = null;
		if (lotname.equals("双色球")) {
			act = SsqxhActivity.class;
		} else if (lotname.equals("超级大乐透")) {
			act = DltxhActivity.class;
		} else if (lotname.equals("福彩3D")) {
			act = Fc3dxhActivity.class;
		} else if (lotname.equals("七乐彩")) {
			act = N7lxhActivity.class;
					//"七乐彩";
		} else if (lotname.equals("排列3")) {
			act = Pailie3xhActivity.class;
					//"排列3";
		} else if (lotname.equals("排列5")) {
			act = Pailie5xhActivity.class;
					//"排列5";
		} else if (lotname.equals("七星彩")) {
			act = N7xxhActivity.class;
					//"七星彩";
		}else if (lotname.equals("胜负彩")) {
			act = CtzqSfcActivity.class;
		} else if (lotname.equals("任选九")) {
			act = CtzqRx9Activity.class;
		}else if (lotname.equals("竞彩足球")) {
			act = JcfootballActivity.class;
		} else if (lotname.equals("竞彩篮球")) {
			act = JcBasketballActivity.class;
		}else if (lotname.equals("足彩单场")) {
			act = BDActivity.class;
		} else if (lotname.equals("11选5")) {
			act = ElvSelFiveActivity.class;
		}else if (lotname.equals("内蒙古快3")) {
			act = Kuai3Activity.class;
		} else if (lotname.equals("十一运夺金")) {
			act = ElvYunDJActivity.class;
		}else if (lotname.equals("重庆时时彩")) {
			act = CQSSCActivity.class;
		}
		return act;
	}

}
